<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<%@page import="entity.tUser"%>
<%@page import="entity.PageBean"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>
<%
	tUser tuser = (tUser) session.getAttribute("user");
%>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
		<title>主页-水处理系统</title>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
		<link href="css/style.css" rel="stylesheet" type="text/css" />

	</head>
	<body align="center">
		<div class="main">
			<jsp:include page="conter/header.jsp"></jsp:include>
			<div class="certen">
				<jsp:include page="conter/deviceLeft.jsp"></jsp:include>
				<div class="content">
					<div class="mainbar">

						<div class="runbutton">
							<h2>
								<span style="margin-left: 25px; letter-spacing: 8px;">设备筛选显示</span>
							</h2>
							<div class="clr"></div>
						</div>
						<div class="device_sel">
							<div class="sel_phno">
								<img src="images/ss.gif" />
								<br />
								<label
									style="font-size: 30px; color: #003399; padding-left: 10px;">
									筛选
								</label>
							</div>
							<form action="searchtDeviceforIndexAction" method="post">
								<table height="80px" style="border: thin solid #0B5990;">
									<tr align="center">
										<s:if
											test="#session.user.grade == 2 || #session.user.grade == 0">
											<td>
												<input type="radio" name="radios" id="deviceArea" value="0"
													checked="true" />
												<label for="deviceArea">
													区域：
												</label>
												<select style="width: 220px;" size="1" id="deviceArea"
													name="deviceArea">
													<option value=""></option>
													<s:iterator id="tarea" value="#request.tarea">
														<option>
															${name}
														</option>
													</s:iterator>

												</select>
											</td>
										</s:if>
										<s:if test="#session.user.grade == 2">
											<td>
												<input type="radio" name="radios" id="userName" value="1" />
												<label for="userName">
													代理商：
												</label>
												<select name="userName" id="userName" size="1"
													style="width: 220px;">
													<option value=""></option>
													<s:iterator id="tuser" value="#request.tuser">
														<option>
															${userName}
														</option>

													</s:iterator>
												</select>
											</td>
										</s:if>
									</tr>
									<tr align="center">
										<td>
											<input type="radio" name="radios" id="industry" value="2" />
											<label for="industry">
												行业：
											</label>
											<select name="industry" id="industry" size="1"
												style="width: 220px;">
												<option value=""></option>
												<option value="石油行业">
													石油行业
												</option>
												<option value="水处理行业">
													水处理行业
												</option>
												<option value="测试行业">
													测试行业
												</option>
											</select>
										</td>
										<td>
											<input type="radio" name="radios" id="yhm" value="3" />
											<label for="values">
												<input type="text" name="values" id="values" value="模糊查找"
													size="29" />
											</label>
											<input type="submit" value="查询" />
										</td>
									</tr>
								</table>
							</form>
						</div>
						<div style="width: 832px; height: auto;">
							<table width="100%" height="100%"
								style="margin-bottom: 10px; margin-top: 20px; text-algin: center;; word-break: break-all; word-wrap: break-all;">
								<tr>
									<td>
										<img src="images/tb.gif"
											style="border: 2px solid #fff; border-radius: 22px; margin-top: -20px;" />
										<span
											style="margin-left: 10px; font-weight: bold; font-size: 18px; color: #595959;">筛选出的设备</span>
									</td>
								</tr>
							</table>
							<table border="0" cellpadding="0" cellspacing="1"
								bgcolor="b5d6e6">
								<tr class="sb_list_top">
									<td width="10%">
										序列号
									</td>
									<td width="10%">
										设备名称
									</td>
									<td width="12%">
										新建时间
									</td>
									<td width="10%">
										区域
									</td>
									<td width="18%">
										详细地址
									</td>
									<td width="20%">
										描述
									</td>
									<td width="10%">
										基本操作
									</td>
								</tr>
								<s:iterator id="lists" value="#request.lists">
									<tr class="sb_list">
										<td>
											<a href="runDeviceAction?deviceId=${deviceId}">${deviceNo
												}</a>
										</td>
										<td>
											<a href="runDeviceAction?deviceId=${deviceId}">${deviceName
												}</a>
										</td>
										<td>
											${addTime }
										</td>
										<td>
											${deviceArea }
										</td>
										<td>
											${place }
										</td>
										<td>
											${deviceDescribe }
										</td>
										<td>
											<img src="images/sxt.gif" height="16" width="16" />
											视频
											<br />
											<img src="images/edt.gif" height="16" width="16" />
											<s:if test="#session.user.grade == 2 || #session.user.grade == 1">
											<s:a
												href="gettDeviceDateToAlter?deviceId=%{#lists.deviceId}&mac=%{#lists.mac}">修改</s:a>
											<br />
											<img src="images/Report.jpg" height="16" width="16" />
											<a
												href="gettDeviceDateToAllot?deviceId=${deviceId}&userId=${userId}">分配</a>
											</s:if>
										</td>
									</tr>
								</s:iterator>

							</table>
							<div class="clr"></div>
						</div>
						<div class="pagenavi">
							<span class="pages">Page &nbsp;&nbsp;<s:property
									value="pageBean.currentPage" /> &nbsp;&nbsp;of &nbsp;&nbsp;<s:property
									value="pageBean.totalPage" /> </span>

							<s:if test="%{pageBean.currentPage == 1}">
								<span class="current"> 首页 </span>上一页
        </s:if>
							<s:else>
								<span class="current"> <a
									href="getAlltDeviceToIndexAction?page=1">首页</a>
								</span>
								<a
									href="getAlltDeviceToIndexAction?page=<s:property value="%{pageBean.currentPage-1}"/>">上一页</a>
							</s:else>
							<s:if test="%{pageBean.currentPage != pageBean.totalPage}">
								<a
									href="getAlltDeviceToIndexAction?page=<s:property value="%{pageBean.currentPage+1}"/>">下一页</a>
								<a
									href="getAlltDeviceToIndexAction?page=<s:property value="pageBean.totalPage"/>">尾页</a>
							</s:if>
							<s:else>
           下一页 尾页
        </s:else>

						</div>
					</div>
					<div class="clr"></div>
				</div>
			</div>
			<script src="js/jquery-1.8.2.min.js" type="text/javascript">
</script>
			<script src="js/jquery.carouFredSel-6.0.4-packed.js"
				type="text/javascript">
</script>
			<div class="fbg">
				<div class="fbg_resize">
					<jsp:include page="conter/slide.jsp"></jsp:include>
				</div>
			</div>
			<jsp:include page="conter/footer.jsp"></jsp:include>
		</div>
	</body>
	<script type="text/javascript">
window.addEventListener(
    'load',
    function() {
        document.getElementById('values').addEventListener(
            'focus',
            function() {
                if (this.value == '模糊查找') {
                    this.value = '';
                }
            }, false
        );

        document.getElementById('values').addEventListener(
            'blur',
            function() {
                if (!this.value) {
                    this.value = '模糊查找';
                }
            }, false
        );
    }, false
);

</script>
</html>